Usage
Get the local IP address of your system by executing the local_ip
function:
use local_ip;
Retrieve all the available network interfaces from both, the AF_INET
and
the AF_INET6
family by executing the list_afinet_netifas
function:
use list_afinet_netifas;
Underlying approach on retrieving network interfaces or the local IP address may differ based on the running operative system.
OS | Approach |
---|---|
Linux | Establishes a Netlink socket interchange to retrieve network interfaces |
BSD-based | Uses of getifaddrs to retrieve network interfaces |
Windows | Consumes Win32 API's to retrieve the network adapters table |
Operating System Support
Current supported platforms include:
- Linux (requires at least v0.1.0);
- macOS (requires at least v0.1.0);
- Windows (requires at least v0.3.0);
- Other BSD-based (requires at least v0.5.0); including:
- FreeBSD
- OpenBSD
- NetBSD
- DragonFly
Please note that we only test the BSD implementation of this on macOS and FreeBSD, under the assumption that other BSD-based systems will behave similarly. If you have any complications using this library on the other BSD-based, please create an issue.
Release
In order to create a release you must push a Git tag as follows
Example
Tags must follow semver conventions Tags must be prefixed with a lowercase
v
letter.
Then push tags as follows:
Contributing
Every contribution to this project is welcome. Feel free to open a pull request, an issue or just by starting this project.
License
Distributed under the terms of both the MIT license and the Apache License (Version 2.0)